home *** CD-ROM | disk | FTP | other *** search
- package com.ibm.ivb.jface.basic;
-
- import com.ibm.ivb.jface.plaf.StatusButtonUI;
- import java.awt.Insets;
- import javax.swing.AbstractButton;
- import javax.swing.JComponent;
- import javax.swing.border.Border;
- import javax.swing.border.CompoundBorder;
- import javax.swing.border.EmptyBorder;
- import javax.swing.plaf.ComponentUI;
- import javax.swing.plaf.basic.BasicButtonUI;
-
- public class BasicStatusButtonUI extends StatusButtonUI {
- private static final String kCBIBMCopyright = "(c) Copyright IBM Corporation 1998";
- protected static BasicStatusButtonUI buttonUI;
- protected static Border border;
- protected static Insets margin = new Insets(0, 0, 0, 0);
-
- public static ComponentUI createUI(JComponent var0) {
- if (buttonUI == null) {
- buttonUI = new BasicStatusButtonUI();
- border = new CompoundBorder(new BasicStatusBorder(), new EmptyBorder(0, 5, 0, 5));
- }
-
- return buttonUI;
- }
-
- public void installUI(JComponent var1) {
- super.installUI(var1);
- AbstractButton var2 = (AbstractButton)var1;
- ((JComponent)var2).setBorder(border);
- var2.setMargin(margin);
- super.defaultTextShiftOffset = 1;
- ((BasicButtonUI)this).setTextShiftOffset();
- }
-
- public void uninstallUI(JComponent var1) {
- super.uninstallUI(var1);
- if (var1.getBorder() == border) {
- var1.setBorder((Border)null);
- }
-
- }
- }
-